'use strict';

module.exports = app => {
  const { router, controller: ctrl } = app;
  const adminauth = app.middleware.adminauth();
  router.get('/admin/index', ctrl.admin.main.index);
  router.post('/admin/checkAuthorToken', ctrl.admin.main.checkLogin);
  router.get('/admin/getTypeInfo', adminauth, ctrl.admin.main.getTypeInfo);
  router.post('/admin/addArticle', adminauth, ctrl.admin.main.addArticle);
  router.post('/admin/addMiQuan', adminauth, ctrl.admin.main.addMiQuan);
  router.post('/admin/addShareTopic', adminauth, ctrl.admin.main.addShareTopic);
  router.get('/admin/getShareTopic', adminauth, ctrl.admin.main.getShareTopic);
  router.post('/admin/updateShareTopic', adminauth, ctrl.admin.main.updateShareTopic);
  router.post('/admin/AddTopicItems', adminauth, ctrl.admin.main.addTopicItems);
  router.get('/admin/getTopicList', adminauth, ctrl.admin.main.getTopicList);
  router.post('/admin/updateMiQuan', adminauth, ctrl.admin.main.updateMiQuan);
  router.get('/admin/delMiquan/:id', adminauth, ctrl.admin.main.delMiquan);
  router.get('/admin/getMiQuanById/:id', adminauth, ctrl.admin.main.getMiQuanById);
  router.get('/admin/getTopicById/:id', adminauth, ctrl.admin.main.getTopicById);
  router.get('/admin/getTopicListById/:id', adminauth, ctrl.admin.main.getTopicListById);
  router.get('/admin/getMiQuanList', adminauth, ctrl.admin.main.getMiQuanList);
  router.post('/admin/updateArticle', adminauth, ctrl.admin.main.updateArticle);
  router.post('/admin/updateTopicItem', adminauth, ctrl.admin.main.updateTopicItem);
  router.get('/admin/getArticleList', adminauth, ctrl.admin.main.getArticleList);
  router.get('/admin/delArticle/:id', adminauth, ctrl.admin.main.delArticle);
  router.get('/admin/delTopicList/:id', adminauth, ctrl.admin.main.delTopicList);
  router.get('/admin/delTopic/:id', adminauth, ctrl.admin.main.delTopic);
  router.get('/admin/getArticleById/:id', adminauth, ctrl.admin.main.getArticleById);

  // 题库系统
  router.get('/admin/getTaskList', ctrl.admin.main.getTaskList);
  router.get('/admin/getTaskType', ctrl.admin.main.getTaskType);
  router.get('/admin/delTaskType/:id', ctrl.admin.main.delTaskType);
  router.post('/admin/addTaskType', ctrl.admin.main.addTaskType);
  router.post('/admin/addTaskStore', ctrl.admin.main.addTaskStore);
  router.post('/admin/addTasklIstanbu', ctrl.admin.main.addTasklIstanbu);
  router.get('/admin/getTaskListById/:id', ctrl.admin.main.getTaskListById);
  router.get('/admin/delTaskStore/:id', ctrl.admin.main.delTaskStore);
  router.post('/admin/updateTaskList/:id', ctrl.admin.main.updateTaskList);
};
